package com.utils.messageFactory;

import com.entity.Member;
import com.utils.MailHtmlUtils;
import com.vo.MailUser;



public class MemberMessageFactory  implements MakeMessage{

    public String[] getMessage(MailUser mailUser, String opDeatil){
        Member member = (Member)mailUser;
        StringBuilder mailMessage = new StringBuilder();
        String subject = null;
        switch (opDeatil){
            case "reg":
                mailMessage.append("<html>");
                mailMessage.append("亲爱的会员"+member.getMname()+":<br>");
                mailMessage.append("注册成功");
                subject = "亲爱的会员"+member.getMname() + "注册XX网站成功";
                break;
            case "addOrder":
                mailMessage.append("亲爱的会员"+member.getMname()+":<br>");
                mailMessage.append("下单成功,购买专家");
                mailMessage.append(member.getMemberflolowexperts().get(0).getExpert().getEname()+"xxx方案");
                mailMessage.append("");
                subject = "亲爱的会员"+member.getMname() + "您的订单已下单成功";
                break;
            case "cancelOrder": break;
            case "timeout": break;
            default:break;
        }
        String [] mail = new String[2];
        mail[0] = subject;
        mail[1] = MailHtmlUtils.initHtml(mailMessage.toString());
        return mail;
    }
}
